home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_09_11 / 9n11116a < prev    next >
Text File  |  1991-10-07  |  728b  |  32 lines

  1.  
  2. Listing 2
  3.  
  4. void find_min_max(one, two, three, minimum, maximum)
  5.    int one, two, three;  /* Input values to compare */
  6.    int *minimum;    
  7.    int *maximum;
  8.        {
  9.        if (one > two)
  10.            {
  11.            if (one > three)
  12.                *maximum = one;
  13.            else
  14.                *maximum = three;
  15.            if (two > three)
  16.                *minimum = three;
  17.            else
  18.                *minimum = two;
  19.        else
  20.            {
  21.            if (two > three)
  22.                *maximum = two;
  23.            else
  24.                *maximum = three;
  25.            if (one > three)
  26.                *minimum = three;
  27.            else
  28.                *minimum = one;
  29.            }
  30.        return ;
  31.        }
  32.